package com.imfondof.mvc_mvp_mvvm.mvp;

import com.imfondof.mvc_mvp_mvvm.bean.Account;
import com.imfondof.mvc_mvp_mvvm.callback.MCallback;

public class MVPPresenter {
    MVPModel mModel;
    IMVPView mView;

    public MVPPresenter(IMVPView mView) {
        this.mView = mView;
        mModel = new MVPModel();
    }

    public void getData() {
        mModel.getAccountData(mView.getUserInput(), new MCallback() {
            @Override
            public void onSuccess(Account account) {
                mView.showSuccess(account);
            }

            @Override
            public void onFailed() {
                mView.showFailed();
            }
        });
    }
}
